package com.yumeng.framework.auth.security.authentication.normal;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.SpringSecurityCoreVersion;

import java.util.Collection;

/**
 * @author wxd
 * @date 2025/3/24 17:19
 */
public class NormalLoginAuthenticationToken extends UsernamePasswordAuthenticationToken {

    private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;

    public NormalLoginAuthenticationToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public NormalLoginAuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
    }

    public static NormalLoginAuthenticationToken unauthenticated(Object principal, Object credentials) {
        return new NormalLoginAuthenticationToken(principal, credentials);
    }
    public static NormalLoginAuthenticationToken authenticated(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        return new NormalLoginAuthenticationToken(principal, credentials, authorities);
    }
}
